//
//  ZYXClassTabCell.m
//  RuiBeiKang
//
//  Created by iOS开发1 on 2019/1/7.
//  Copyright © 2019年 JW. All rights reserved.
//

#import "ZYXClassTabCell.h"

@implementation ZYXClassTabCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
   
}

-(void)setModel:(ZYXClassificationModel *)model{
    _model = model;
    NSLog(@"%@",kImgAllUrl(model.picUrl));
    ///图片地址
    [self.imgView sd_setImageWithURL:[NSURL URLWithString:kImgAllUrl(model.picUrl)] placeholderImage:IMG(@"imgLoading")];
    self.titleLabel.text = model.title;
    self.contentLabel.text = model.introduce;
    if (model.chapter.length >0) {
        NSMutableAttributedString *str1 = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"共%@节",model.chapter]];
        NSRange range1 = [[str1 string] rangeOfString:model.chapter];
        [str1 addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithHexString:@"1cca62"] range:range1];
        self.bunClassLabel.attributedText = str1;
        NSMutableAttributedString *str2 = [[NSMutableAttributedString alloc] initWithString: [NSString stringWithFormat:@"%@人学过",model.attention]];
        
        NSRange range2 = [[str2 string] rangeOfString:model.attention];
        [str2 addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithHexString:@"1cca62"] range:range2];
        self.contentRead.attributedText = str2;
    }
  
    
    
    
}

@end
